from selenium import webdriver
import time
from selenium.webdriver.common.by import By

dr = webdriver.Chrome()
dr.get("file:///C:/Users/Administrator/Desktop/弹窗.html")
dr.maximize_window()
time.sleep(2)
# 信息输入框
dr.find_element(By.ID,"btn2").click()
e = dr.switch_to.alert
time.sleep(2)
e.send_keys("12") # 输入的时候不会显示 但是也输入成功
time.sleep(2)
# 点击确定
e.accept() # 取消操作 e.dismiss()
time.sleep(2)
dr.quit()
